﻿<%@ Page Language="C#" MasterPageFile="~/Templates/Public.master" AutoEventWireup="true"
    CodeFile="recent-posts.aspx.cs" Inherits="recent_posts" %>

<%@ Register Src="Controls/customPager.ascx" TagName="customPager" TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">


   
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="LeftContent" runat="Server">
    <table width="100%" border="0">
        <tr class="CommonHeaderBackground">
            <td style="padding-left:5px;">
                <asp:Literal ID="litCategory" runat="server"></asp:Literal>
            </td>
        </tr>
        <tr>
            <td align="left" valign="top">
                <asp:Literal ID="litCategoryDescription" runat="server"></asp:Literal>
                <br />
            </td>
        </tr>
        <tr>
            <td align="left" valign="middle" class="Seperator">
                <asp:ImageButton ID="imbStartTopic" runat="server" SkinID="ImageStartNewTopic" OnClick="imbStartTopic_Click" />
            </td>
        </tr>
        <tr>
            <td align="left" valign="middle">
                <uc1:customPager ID="customPager1" runat="server" OnPageIndexChanged="lkbPageIndex_Command" />
            </td>
        </tr>
        <tr>
            <td align="center" valign="top">
                <asp:GridView ID="grvPosts" runat="server" SkinID="GridViewPosts">
                    <Columns>
                        <asp:TemplateField>
                            <ItemTemplate>
                                <a href='show-topic.aspx?id=<%# Eval("PostID")%>&cat=<%= ID %>'>
                                    <asp:Image ID="imgNew" runat="server" SkinID="ImageNewPost" />
                                </a>
                            </ItemTemplate>
                            <ItemStyle Width="5%" HorizontalAlign="Center" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Topic/Author">
                            <ItemTemplate>
                                <a href='show-topic.aspx?id=<%# Eval("PostID")%>&cat=<%= ID %>'>
                                    <%# Eval("PostTitle")%></a>
                                <br />
                                <asp:Label ID="lblPost" runat="server" Text=' <%# "by "+Eval("UserName")%>' CssClass="PostSub"></asp:Label>
                            </ItemTemplate>
                            <ItemStyle Width="60%" HorizontalAlign="Left" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Latest Post">
                            <ItemTemplate>
                                <%# Eval("LatestPostUserName")%>
                                <br />
                                <asp:Label ID="lbllatestPost" runat="server" Text='<%# string.Format("{0:ddd, dd MMM yyyy hh:mm tt}",Eval("LatestPostDate"))%>'
                                    CssClass="PostSub"></asp:Label>
                            </ItemTemplate>
                            <ItemStyle Width="25%" HorizontalAlign="Left" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Replies">
                            <ItemTemplate>
                                <%# string.Format("{0:d}",Eval("TotalReply"))%>
                            </ItemTemplate>
                            <ItemStyle Width="10%" HorizontalAlign="Right" />
                            <HeaderStyle Width="10%" HorizontalAlign="Right" />
                        </asp:TemplateField>
                    </Columns>
                </asp:GridView>
            </td>
        </tr>
        <tr>
            <td align="left" valign="middle">
                <uc1:customPager ID="customPager2" runat="server" OnPageIndexChanged="lkbPageIndexBottom_Command" />
            </td>
        </tr>
    </table>
   
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="RightContent" runat="Server">
</asp:Content>
